{{useCss "/app-pages/css/user/order.scss"}}
<div class="mainbox">
    {{#each $Cache.user.order.achs}}
    <userorder></userorder>
    {{/each}}
    <button class='btn' disabled="{{$Cache.user.order.ismore&&'disabled'}}" event-click="{{'$Event.user.order.get_more_order'}}">
        {{#if $Cache.user.order.isloading}}正在加载{{#else}}{{$Cache.user.order.ismore&&'没有了哦'||'查看更多'}}{{/if}}
    </button>
</div>

<xmp type="tag" name="userorder">
    <div class="orderitem">
        <div class="orderinfo">
            <div class="item">
                订单：
                <href class="method" to="/pay.html?ach_id={{_id}}">
                {{_id+" ("+info.bus_id}})
                </href>
            </div>
            <div class="item">
                下单时间：{{#Time create_time,"YYYY-MM-DD HH:mm:ss"}}
            </div>
            <div class="item">
                总花费额：{{#Fixed cash}}
            </div>
        </div>
        <div class="ordergoods">
            {{#each info.goods_info}}
            <div class="item">
                <div class="img">
                    <href to="/goods_details.html?id={{goods._id}}">
                        <img bind-src="{{goods.preview_img_url}}?imageView/1/w/40/h/40">
                    </href>
                </div>
                <div class="info">
                    <div>
                        {{goods.goods_name}}
                    </div>
                    <div>
                        单价：{{#Fixed goods.cash}}　　数量：{{num}}
                    </div>
                </div>
            </div>
            {{/each}}
        </div>
        <div class="orderinfo">
            <div class="item">
            
                <!-- 在线付款 -->
                <!-- 未付款 -->
                {{#if info.state==$Top.config.ACH_STATE.未确认}}
                <a class="method" event-click="{{'$Top.$Event.user.order.pays.lock_ach'}}">提交订单 </a>
                或
                <a class="method" event-click="{{'$Top.$Event.user.order.pays.cancel_ach'}}"> 取消订单</a>
                或
                <href class="method" to="/pay.html?ach_id={{_id}}"> 修改支付方式</href>
                {{/if}}
                <!-- 未付款 -->
                {{#if info.state==$Top.config.ACH_STATE.ol未付款}}
                <href class="method" to="/pay.html?ach_id={{_id}}">去付款 </href>
                或
                <a class="method" event-click="{{'$Top.$Event.user.order.pays.cancel_ach'}}"> 取消订单</a>
                {{/if}}
                <!-- 已付款 -->
                {{#if info.state==$Top.config.ACH_STATE.ol未发货}} 等待货物发出 {{/if}}
                <!-- 运货中 -->
                {{#if info.state==$Top.config.ACH_STATE.ol未收货}} 货物已经发出
                <href class="method" to="/user/express.html?id={{_id}}&num={{info.express_info.num}}&com={{info.express_info.company}}">查看物流</href>
                或
                <a class="method" event-click="{{'$Top.$Event.user.order.pays.confirm_goods'}}">确认收货</a>
                {{/if}}
                <!-- 确认收货 -->
                {{#if info.state==$Top.config.ACH_STATE.ol交易完成}}交易完成,<href class="method" to="/user/comment.html?id={{_id}}">去评价</href>
                <!-- <a class='method'>评价</a> -->
                {{/if}} {{#if info.state==$Top.config.ACH_STATE.ol已评价}}交易结束，<href class="method" to="/user/comment.html?id={{_id}}">查看评价</href>{{/if}}
                <!-- 货到付款 -->
                <!-- 未发货 -->
                {{#if info.state==$Top.config.ACH_STATE.未发货}} 等待发货 或
                <a class="method" event-click="{{'$Top.$Event.user.order.pays.cancel_ach'}}">取消订单</a>
                {{/if}}
                <!-- 运货中 -->
                {{#if info.state==$Top.config.ACH_STATE.已发货}}
                <href class="method" to="/user/express.html?id={{_id}}&num={{info.express_info.num}}&com={{info.express_info.company}}">查看物流</href>
                或
                <a class="method" event-click="{{'$Top.$Event.user.order.pays.confirm_goods'}}">确认收货</a>
                {{/if}}
                <!-- 确认收货并付款 -->
                {{#if info.state==$Top.config.ACH_STATE.未收货未付款}} 等待商家确认收款 {{/if}}
                <!-- 未评价2 -->
                {{#if info.state==$Top.config.ACH_STATE.交易完成}} 交易完成,
                <href class="method" to="/user/comment.html?id={{_id}}">去评价</href>
                {{/if}}
                <!-- 已经评价 -->
                {{#if info.state==$Top.config.ACH_STATE.已评价}}交易结束，<href class="method" to="/user/comment.html?id={{_id}}">查看评价</href>{{/if}}
            </div>
        </div>
    </div>
</xmp>
